import { ApiProperty } from '@nestjs/swagger';
import { IsArray, IsNotEmpty, IsString, ValidateNested } from 'class-validator';
import { Type } from 'class-transformer';

class ResourceNameDto {
  @ApiProperty({
    description: 'Name of the resource being uploaded',
    example: 'my-document.pdf',
  })
  @IsNotEmpty()
  @IsString()
  resourceName: string;
}

export class BatchUploadUrlRequestDto {
  @ApiProperty({
    description: 'Array of resource names to generate upload URLs for',
    type: [ResourceNameDto],
    example: [{ resourceName: 'document1.pdf' }, { resourceName: 'image1.jpg' }],
  })
  @IsArray()
  @ValidateNested({ each: true })
  @Type(() => ResourceNameDto)
  resources: ResourceNameDto[];
}
